

class Animal:
    def speak(self):
        pass

class Dog(Animal):
    def speak(self):
        print("汪汪汪")

class Cat(Animal):
    def speak(self):
        print("喵喵喵")

def make_noise(animal):
        animal.speak()

#演示多态，使用两个子类对象调用函数
dog=Dog()
cat=Cat()

make_noise(dog)
make_noise(cat)

class AC:
     def cool_wind(self):
          pass
     def hot_wind(self):
          pass
     def swing_l_r(self):
          pass

class Midea_AC(AC):
     def cool_wind(self):
          print("media cool wind")
     def hot_wind(self):
          print("media hot_wind wind")
     def swing_l_r(self):
          print("media swing_l_r wind")

class Gree(AC):
     def cool_wind(self):
          print("Gree cool wind")
     def hot_wind(self):
          print("Gree hot_wind wind")
     def swing_l_r(self):
          print("Gree swing_l_r wind")

def make_cool(ac):
     ac.cool_wind()

media_ac=Midea_AC()
gree_ac=Gree()

make_cool(media_ac)
make_cool(gree_ac)